<h1><?php echo $header;?></h1>
<table style="border: #000 1px solid">
    <tr>
        <td>Nganh hoc</td>
        <td>Ten Mon Hoc</td>
        <td>Trang thai</td>
    </tr>
    <?php foreach ($result as $row):?>
    <tr>
        <td><?php if ($nganh===NULL) echo $row['TenNganhHoc']; else echo $nganh;?></td>
        <td><?=$row['TenMonHoc'];?></td>
        <td><?php if ($row['anhien']==0) echo "An"; 
                  else echo "Hien";?>
        </td>
    </tr>
    <?php endforeach;?>
</table>